import Vue from 'vue';
import Vuex from 'vuex';
import getters from './getters';
import mutations from './mutations';
import * as actions from './actions';
import menu from './modules/menu.js';

Vue.use(Vuex);

const state = {
  needAddParkinglotFirst: false,
  skinType: 0, //框架皮肤
  isFullScreenTable: false, //是否全屏表格
  isMask: false, //是否有透明遮罩
  isLoading: false, //是否显示Loading
  isToasting: false, //是否显示Toast
  isHideSideBar: false, //是否隐藏侧边栏
  toast: {
    //toast的相关设置
    info: '完成操作',
    icon: 0,
    time: 1000,
    onHidden: null
  },
  allMenu: {
    // 所有菜单
    list: [],
    active: 0
  },
  test: '',
  sideMenu: {
    //侧边栏菜单项
    list: [],
    firstIndex: 0
  },
  tab: {
    //tab栏
    list: [],
    active: 0,
    isSynchronize: false
  },
  modal: {
    // 用于存储 多层modal情况下 的数据
    active: [],
    deactive: []
  },
  dialog: {
    isDialog: false,
    title: '温馨提示',
    contents: '',
    btnGroup: ['确 认', '取 消'],
    confirmCallback: null,
    cancelCallback: null,
    tipText: '',
  },
  keyBoard: {
    isNumber: false,
    Val: '',
    isShow: false,
    previewPic: ''
  },
  logoObj: {
    logoImg: null,
    merchantLoginImg: null,
    platformName: ''
  },
  perms: JSON.parse(sessionStorage.getItem('perms')) || [],
  userInfo: {},
  reportForms: {
    financialReport: [
      {
        name: '临停收费报表',
        link: '/report/tmp_charge',
        power: 'REPORT:TMP_CHARGE'
      },
      {
        name: '临停收费报表（新）',
        link: '/report/tmp_charge_new',
        power: 'REPORT:TMP_CHARGE_NEW'
      },
      {
        name: '月票收入汇总',
        link: '/park_vip/daily_report',
        power: 'PARKVIP:DAILY_REPORT'
      },
      {
        name: '月票统计报表',
        link: '/report/vip_charge',
        power: 'REPORT:VIP_CHARGE'
      },
      {
        name: '通道收费报表',
        link: '/report/channel_charge',
        power: 'REPORT:CHANNEL_CHARGE'
      },
      {
        name: '通道收费报表(新)',
        link: '/report/channel_charge_new',
        power: 'REPORT:CHANNEL_CHARGE_NEW'
      },
      {
        name: '交接班记录',
        link: '/report/shift',
        power: 'REPORT:SHIFT'
      },
      // {
      //   name: '交接班记录(新)',
      //   link: '/report/shift_new',
      //   power: 'REPORT:SHIFT_NEW'
      // },
      {
        name: '收费员报表',
        link: '/report/tollCollector',
        power: 'REPORT:TOLLCOLLECTOR'
      },
      // {
      //   name: '电子发票报表',
      //   link: '/user_invoice/invoice_form',
      //   power: 'USER_INVOICE:INVOICE_FORM'
      // },
      {
        name: '车场积分报表',
        link: '/score/report',
        power: 'SCORE:DAILYREPORT'
      },
      // {
      //   name: '预订报表',
      //   link: '/booking/booking_form',
      //   power: 'MGR:SHARE:BOOKING_FORM'
      // },
      {
        name: '商家报表',
        link: '/report/trader',
        power: 'REPORT:TRADER'
      },
      {
        name: '月票财务报表',
        link: '/report/monthTicket_finance_report',
        power: 'MONTH:TICKET:FINANCE:LIST'
      },
      {
        name: '城市运营券使用记录',
        link: '/cityCoupon/useRecord',
        power: 'CITY_COUPON:USE_RECORD'
      },
      {
        name: '临停支付统计报表',
        link: '/report/payment_new',
        power: 'REPORT:PAYMENT_NEW'
      }
    ],
    operateReport: [
      {
        name: '进出场报表',
        link: '/report/parking_record',
        power: 'REPORT:PARKING_RECORD'
      },
      {
        name: '通道进出报表',
        link: '/report/channel',
        power: 'REPORT:CHANNEL'
      },
      {
        name: '支付统计报表',
        link: '/report/payment',
        power: 'REPORT:PAYMENT'
      },
      {
        name: '支付方式明细报表',
        link: '/report/pay_mode',
        power: 'REPORT:PAY_MODE'
      },
      {
        name: '月票分月收入汇总',
        link: '/park_vip/month_income',
        power: 'PARKVIP:MONTH_REPORT'
      },
      { 
        name: '月票收费报表',
        link: '/report/month_ticket_bill_payment_report',
        power: 'MONTH:TICKET:BILL:PAYMENT_REPORT'
      },
    ]
  }
};

export default new Vuex.Store({
  state,
  getters,
  actions,
  mutations,
  modules: {
    menu
  }
});
